import { createRouter, createWebHistory } from 'vue-router'
import Main from '@/pages/main.vue'
import Film from '@/pages/film/index.vue'
import FilmDetail from '@/pages/film/detail.vue'
import Cart from '@/pages/cart/index.vue'
import Order from '@/pages/order/index.vue'
import Other from '@/pages/other/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      redirect: "/film",
      component: Main,
      children: [
        {
          path: '/film',
          name: 'film',
          component: Film
        },
        {
          path: '/filmDetail',
          name: 'filmDetail',
          component: FilmDetail
        },
        {
          path: '/cart',
          name: 'cart',
          component: Cart
        },
        {
          path: '/order',
          name: 'order',
          component: Order
        },
        {
          path: '/other',
          name: 'other',
          component: Other
        }
      ]
    },
  ]
})

export default router
